{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class=""><a href="{:url('article/index')}">文章管理</a></li>
            <li class="layui-this">添加文章</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" action="{:url('article/add')}" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" value="" required  lay-verify="required" placeholder="请输入标题" class="layui-input">
                        </div>
                    </div>
                   <!--<div class="layui-form-item">
                        <label class="layui-form-label">作者</label>
                        <div class="layui-input-block">
                            <input type="text" name="author" value="" placeholder="（选填）请输入作者" class="layui-input">
                        </div>
                    </div>--> 
                    <div class="layui-form-item layui-form-text" style="width: 95%;margin-left: 3%;">
						<div id="div1" class="toolbar" style="background-color: #d4cece;"></div>
			    		<div id="div2" class="text" style="height: 350px;background-color: #f7f7f7;" ></div>
			    		<textarea name="content" id="content" style="display: none;"></textarea>
					</div>
                   <!-- <div class="layui-form-item">
						<label class="layui-form-label">时间</label>
						<div class="layui-input-block">
							<input type="text" id="datetime" name="add_time" class="layui-input">
						</div>
					</div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-block">
                            <input type="radio" name="status" value="1" checked title="已发布">
                            <input type="radio" name="status" value="0" title="未发布">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">排序</label>
                        <div class="layui-input-block">
                            <input type="text" name="sort" class="layui-input">
                        </div>
                    </div>-->
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" onclick="content_vale()" lay-submit lay-filter="*">保存</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script src="/public/static/release/wangEditor.min.js"></script>
<script>
	//富文本编辑器
    var E = window.wangEditor;
    var editor1 = new E('#div1', '#div2');
    editor1.customConfig.uploadImgShowBase64 = true
    editor1.create();
    
    function content_vale(){
    	$("#content").val(editor1.txt.html());
    }
    
</script>
{/block}